﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WaterlevelAbnormal.aspx.cs" Inherits="GroundWater.waterlevel.WaterlevelAbnormal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server"><asp:ScriptManager ID="scriptManager" runat="server" />
    <div class="region" style="width: 96%; font-size:9pt;">
        <table style="width: 100%;">
            <tr>
                <td>日期从:</td><td><asp:TextBox runat="server"  id="txtStartDate"   />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtStartDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <td>到:</td><td><asp:TextBox runat="server"  id="txtEndDate"  />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtEndDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <%--<td>最近天数：</td><td><asp:TextBox  id="txtDays" runat="server" Width="50" Text="1" /></td>--%>
                <td>告警差值：</td><td><asp:TextBox  id="txtDifference" runat="server" Width="50" Text="0.20" />(m)</td>
                <td><asp:Button ID="btnCheck" runat="server" Text="检查"  onclick="btnCheck_Click"  OnClientClick="return validateData();" /></td>
            </tr>
            <%--<tr>
                <td>日期从:</td><td><asp:TextBox runat="server"  id="txtStartDate"   />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtStartDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <td>到:</td><td><asp:TextBox runat="server"  id="txtEndDate"  />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtEndDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <td><asp:Button ID="btnQuery" runat="server" Text="查询"  onclick="btnQuery_Click" /></td>
            </tr>--%>
        </table>
    </div>
    
<%--<asp:ObjectDataSource ID="odsLastAbnormal" runat="server" SelectMethod="FetchByTimeSpan" DeleteMethod="DeleteById" TypeName="GroundWater.BusinessActions.WaterlevelAbnormal"  onselecting="odsLastAbnormal_Selecting" >
    <SelectParameters>
        <asp:Parameter Name="startDate" Type="String"  />
        <asp:Parameter Name="endDate" Type="String"  />
        <asp:Parameter Name="warningDifference" Type="Decimal"  />
    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="isStoredProc" Type="Boolean" DefaultValue="False" />
    </DeleteParameters>
</asp:ObjectDataSource>--%>

<%--<asp:ObjectDataSource id="odsAbnormal" runat="server" EnablePaging="True"  TypeName="GroundWater.BusinessActions.WaterlevelAbnormal"  SelectMethod="FetchPaged" SelectCountMethod="FetchRowCount" DeleteMethod="DeleteById" SortParameterName="sortExpression">
    <SelectParameters>
        <asp:ControlParameter ControlID="txtStartDate" PropertyName="Text" Name="startDate" />
        <asp:ControlParameter ControlID="txtEndDate" PropertyName="Text" Name="endDate" />
    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="isStoredProc" Type="Boolean" DefaultValue="False" />
    </DeleteParameters>
</asp:ObjectDataSource>--%>
    
    <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
    <div style="width:100%; margin-top:10px;" id="laseWarning" runat="server" >
        <p style="font-weight:bold; font-family:Tahoma; margin-bottom:8px; "></p>
        <div class="grid">
            <div class="rounded">
                <div class="top-outer"><div class="top-inner"><div class="top">
                    <h2>异常水位信息</h2>
                </div></div></div>
                <div class="mid-outer"><div class="mid-inner"><div class="mid">     
                
                    <!-- Content Goes Here!DataSourceID="odsLastAbnormal" -->
                    
                            <%--<asp:GridView  ID="gvWarning" runat="server"   SkinID="DefaultGridView" DataKeyNames="Id" OnRowDataBound="RowDataBound" AllowSorting="true" EnableViewState="false" >
                                <Columns>
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName" SortExpression="WellCode" HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="监测时间" DataField="MonitoringDate"   SortExpression="MonitoringDate"  />
                                    <asp:BoundField  HeaderText="上次水位" DataField="PreviousWaterlevel"   SortExpression="PreviousWaterlevel"    />
                                    <asp:BoundField  HeaderText="本次水位" DataField="CurrentWaterlevel" SortExpression="CurrentWaterlevel"  />
                                    <asp:BoundField  HeaderText="差值" DataField="Difference"     SortExpression="Difference"  />
                                    <asp:BoundField  HeaderText="告警差值" DataField="WarningDifference"    SortExpression="WarningDifference"   />
                                    <asp:BoundField  HeaderText="报告时间" DataField="ExamineDate"     SortExpression="ExamineDate"  />
                                    <asp:BoundField  HeaderText="报告者" DataField="Examiner"    SortExpression="Examiner"   />
                                </Columns>
                            </asp:GridView>--%>
                            
                            <asp:GridView  ID="gvWarning" runat="server"   SkinID="DefaultGridView" DataKeyNames="Id" OnRowDataBound="RowDataBound" AllowSorting="true" EnableViewState="false" >
                                <Columns>
                                
                                    <asp:BoundField  HeaderText="水井编号" DataField="WellCode"  HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName"  />
                                    <asp:BoundField  HeaderText="监测时间" DataField="MonitoringDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HtmlEncode="false"     />
                                    <asp:BoundField  HeaderText="上次水位" DataField="PreviousWaterlevel"  DataFormatString="{0:N2}"     />
                                    <asp:BoundField  HeaderText="本次水位" DataField="CurrentWaterlevel" DataFormatString="{0:N2}" />
                                    <asp:BoundField  HeaderText="差值" DataField="Difference"   DataFormatString="{0:N2}"   />
                                    <%--<asp:BoundField  HeaderText="告警差值" DataField="WarningDifference"  DataFormatString="{0:N2}"    />--%>
                                    <asp:ImageField  DataImageUrlField="IsRising" DataImageUrlFormatString="{0}" ></asp:ImageField>
                                    <%--<asp:BoundField  HeaderText="报告时间" DataField="ExamineDate"      />
                                    
                                    <asp:BoundField  HeaderText="报告者" DataField="Examiner"       />--%>
                                </Columns>
                            </asp:GridView>
                                         
    
                </div></div></div>
            <div class="bottom-outer"><div class="bottom-inner">
            <div class="bottom"></div></div></div>                   
        </div>      
        </div>
    </div>
   <%-- DataSourceID="odsAbnormal"--%>
   
    <%--<asp:Label ID="lblEmpty" runat="server" Text="" Visible="false" EnableViewState="false"></asp:Label>--%>
    <asp:Literal ID="lblEmpty" EnableViewState="false" runat="server"></asp:Literal>
   
    <div style="width:100%; margin-top:10px;" id="allWarning" runat="server">
        <p style="font-weight:bold; font-family:Tahoma; margin-bottom:8px; "></p>
        <div class="grid">
            <div class="rounded">
                <div class="top-outer"><div class="top-inner"><div class="top">
                    <h2>异常水位信息</h2>
                </div></div></div>
                <div class="mid-outer"><div class="mid-inner"><div class="mid">     
                
                    <!-- Content Goes Here! -->
                    
                            <asp:GridView  ID="GridView1" runat="server"   SkinID="PagingGridView" DataKeyNames="Id" OnRowDataBound="RowDataBound" EnableViewState="false" >
                                <Columns>
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName" SortExpression="WellCode" HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="监测时间" DataField="MonitoringDate"   SortExpression="MonitoringDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HtmlEncode="false" />
                                    <asp:BoundField  HeaderText="上次水位" DataField="PreviousWaterlevel"   SortExpression="PreviousWaterlevel"    />
                                    <asp:BoundField  HeaderText="本次水位" DataField="CurrentWaterlevel" SortExpression="CurrentWaterlevel"  />
                                    <asp:BoundField  HeaderText="差值" DataField="Difference"     SortExpression="Difference"  />
                                    <asp:BoundField  HeaderText="告警差值" DataField="WarningDifference"    SortExpression="WarningDifference"   />
                                    <asp:BoundField  HeaderText="报告时间" DataField="ExamineDate"     SortExpression="ExamineDate"  />
                                    <asp:BoundField  HeaderText="报告者" DataField="Examiner"    SortExpression="Examiner"   />
                                    <asp:CommandField ShowDeleteButton="true" DeleteText="删除" />
                                </Columns>
                            </asp:GridView>   
                                        
    
                </div></div></div>
            <div class="bottom-outer"><div class="bottom-inner">
            <div class="bottom"></div></div></div>                   
        </div>      
        </div>
    </div>
    
    </ContentTemplate>
                        <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnCheck" />
                        <%--<asp:AsyncPostBackTrigger ControlID="btnQuery" />--%>
                        </Triggers>
                    </asp:UpdatePanel>     
    
<asp:updateprogress id="updateProgress" runat="server" DynamicLayout="true" DisplayAfter="300">
    <progresstemplate>
        <div id="progressBackgroundFilter"></div>
        <div id="processMessage">正在处理数据，请稍等...<br /><br /><img alt="Loading" src="../images/loading_16.gif" /></div>
    </progresstemplate>
</asp:updateprogress>
    </form>
    
    
    
<script type="text/javascript">
    //<![CDATA[
    function validateData() {
        var message = "";
        if (!notEmpty($get("txtStartDate"))) {
            message += "起始日期不能为空。\n";
        }
        if (!isNum($get("txtDifference").value)) {
            message += "告警差值为数值。\n";
        }

        if (!validateCNDate($get("txtStartDate").value)) {

            message += "起始日期格式不正确。\n";
        }
        if (!validateCNDate($get("txtEndDate").value)) {

            message += "截至日期格式不正确。\n";
        }

        if (parseFloat($get("txtDifference").value) == 0) {
            message += "告警差值不能为0。\n";
        }

        if (message.length > 0) {
            alert(message);
            return false;
        }
        return true;
    }





    //]]>
</script>
    
    <script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
